// pages/personal/sale/my-team.js


const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        page: 1,
        total: 2,
        list: [],
        loading: false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.loadData()
    },

    loadData() {
        if (this.data.loading || this.data.page > this.data.total) {
            return
        }
        wx.showLoading({
            title: '加载中...',
        })
        app.http.get("member/my-fans").then(res => {
            const list = this.data.list
            list.push(...res.data.items)
            this.setData({
                page: this.data.page + 1,
                total: res.data.total,
                list,
                loading: false
            })
            wx.hideLoading()
        }).catch(err => {
            app.wxToast.error(err.message)
        })
    }
})